/**
 * 工具标签
 * @namespace iToolTag
 */
import { InterfaceProxy } from 'mider'
import { defaultOptions } from './_options'

/** @lends iToolTag# */
const interfaceOpt = {
  findAll: {
    name: '获取所有标签',
    url: '/v1/tool-api/tag/actions/findAll',
    method: 'post',
    params: {},
    merge: true
  },
  findPages: {
    name: '分页查找',
    url: '/v1/tool-api/tag/actions/findPages',
    method: 'post',
    params: {
      offset: Number,
      limit: Number,
      query: {
        tags: Array
      }
    }
  },
  create: {
    name: '新增',
    url: '/v1/tool-api/tag/actions/create',
    method: 'post',
    params: Object
  },
  updateById: {
    name: '根据 ID 更新',
    url: '/v1/tool-api/tag/actions/updateById',
    method: 'post',
    params: {
      id: String,
      update: Object
    }
  },
  deleteById: {
    name: '根据 ID 删除',
    url: '/v1/tool-api/tag/actions/deleteById',
    method: 'post',
    params: {
      id: String
    }
  },
  updateStatus: {
    name: '更新状态',
    url: '/v1/tool-api/tag/actions/updateStatus',
    method: 'post',
    data: {
      id: String,
      status: Number
    }
  }
}

/** @mixes iToolTag */
const iToolTag = new InterfaceProxy(interfaceOpt, defaultOptions)
export default iToolTag
